//
//  CourseTwoViewController.m
//  IhuayuanClient
//
//  Created by 黄思清 on 2017/7/3.
//  Copyright © 2017年 com.ihuayuan. All rights reserved.
//

#import "CourseTwoViewController.h"

@interface CourseTwoViewController ()<UIWebViewDelegate>
@property (strong,nonatomic) UIWebView *webView;

@end

@implementation CourseTwoViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    _webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, MAIN_SCREEN_WIDTH, MAIN_SCREEN_HEIGHT-200)];
    _webView.backgroundColor = [UIColor whiteColor];
    self.view.backgroundColor = [UIColor whiteColor];
    _webView.delegate=self;
    [_webView setScalesPageToFit:YES];//自动缩放以适应屏幕
    [self.view addSubview:_webView];
    
    //加载网页的方式
    //1.创建并加载远程网页
    NSLog(@"%@",self.cid);

    NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@/index.php?g=App&m=StudentCourse&a=courseOutline&cid=%@&uid=%@&access_token=%@",KUrl,self.cid,[[NSUserDefaults standardUserDefaults]objectForKey:kUserId],[[NSUserDefaults standardUserDefaults]objectForKey:kAccessToken]]];

    [_webView loadRequest:[NSURLRequest requestWithURL:url]];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
